 <?php
class RoutePlugin extends \Yaf\Plugin_Abstract {
	public function routerStartup(\Yaf\Request_Abstract $request, \Yaf\Response_Abstract $response) {
		$uri = $_SERVER['REQUEST_URI'];
		$uri = ltrim($uri, '/');
		$len = strlen(\Yaf\Registry::get("urlPrefix"));
		if (strpos($uri, '?') !== FALSE) {
			$uri = substr($uri, $len, strpos($uri, '?') - $len);
		} else {
			$uri = substr($uri, $len);
		}
		$request->setRequestUri($uri);
	}
	public function preDispatch(\Yaf\Request_Abstract $request, \Yaf\Response_Abstract $response) {
		\Yaf\Dispatcher::getInstance()->disableView();
	}
}